AddPrefabPostInit("world", function(inst)
    inst:ListenForEvent("playeractivated", function(world, player)
        local hl = GetEquippedItemFrom("head")
        if hl and hl.prefab == "alterguardianhat" then
            local c =  hl.components.container or hl.replica.container
            if c then
                c:Close()
            end
        end
    end)
end)